#include <glib.h>

void _list_interger_print(gpointer data, gpointer user_data)
{
    g_print("data is: %d, user_data is: %s \n", GPOINTER_TO_INT(data), (gchar *)user_data);
}

gint main(gint argc, gchar **argv)
{
    GList *list = NULL;

    list = g_list_prepend(list, GINT_TO_POINTER(1));
    list = g_list_prepend(list, GINT_TO_POINTER(3));
    list = g_list_prepend(list, GINT_TO_POINTER(5));

    list = g_list_reverse(list);

    g_list_foreach(list, _list_interger_print, (gchar *)"<user data>");

    g_list_free(list);

    return 0;
}